<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- wwWidgets-manual.qdoc -->
<head>
  <title>Qt 1.0: Use of icons</title>
  <link href="classic-4.6.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">wwWidgets Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230">
<a href="http://www.wysota.eu.org/wwwidgets"><img src="images/ww-logo.png" align="right" width="137" height="41" border="0" /></a>
</td></tr></table><h1 class="title">Use of icons<br /><span class="subtitle"></span>
</h1>
<a name="icon-themes"></a>
<h3>Icon themes</h3>
<p>Since version 4.6 of Qt it is possible to use standard (according to freedesktop.org) themes for icons. When supported, <a href="wwwidgets.html">wwWidgets</a> tries to pick up appropriate icons from the icon theme before using custom icons. Therefore it is possible to substitute most icons in the set by using an own icon theme.</p>
<p>On systems where icon themes are preinstalled (i.e&#x2e; Linux) - usually in /usr/share/icons, everything works out of the box. On other systems (i.e&#x2e; Windows) to use icon themes it is required that an icon theme is installed in the system and the path to the theme is set using <a href="http://qt.nokia.com/doc/4.7/qicon.html#setThemeSearchPaths">QIcon::setThemeSearchPaths</a>() static call. To use another theme, <a href="http://qt.nokia.com/doc/4.7/qicon.html#setThemeName">QIcon::setThemeName</a>() can be used.</p>
<p>Qt provides a fallback mechanism that allows to embed icon themes directly in the application binary by placing the theme under the <tt>:/icons</tt> resource directory. More information on icon themes can be found in Qt documentation and <a href="http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html">standards.freedesktop.org</a>.</p>
<pre> int main(int argc, char **argv){
   QApplication app(argc, argv);
   QStringList iconThemes;
   iconThemes &lt;&lt; QApplication::applicationDirPath()+&quot;/icons&quot;;
   QIcon::setThemeSearchPaths(iconThemes);
   QwwFileChooser chooser;
   chooser.show();
   return app.exec();
 }</pre>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%" align="left">Copyright &copy; 2007-2010 Witold Wysota 
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">wwWidgets 1.0.0</div></td>
</tr></table></div></address></body>
</html>
